import { geoCentroid } from "d3-geo";
import * as fs from "fs";
const data = fs.readFileSync("./地震测试.geojson", "utf8");
let featArray = JSON.parse(data).features;
const a = featArray.map((item) => {
  return {
    name: item.properties.Name,
    center: item.geometry.coordinates,
    centroid: item.geometry.coordinates,

  };
});
fs.writeFileSync("test.js",JSON.stringify(a),'utf8')